const http = require('../utils/http.js');

// 获取用户信息
const getUser = () => {
    return http.request('GET', '/User/current');
    // return http.request('GET', 'user/login');
}

// 解密手机号
const decodePhone = (params) => {
    return http.request('GET', `/WeiXin/WxOpen/DecryptPhoneNumber?sessionId=${params.sessionId}&encryptedData=${params.encryptedData}&iv=${params.iv}`)
}

// 更新手机号
const updatePhone = (params) => {
    return http.request('GET', `/WeiXin/WxOpen/UpdatePhone?sessionId=${params.sessionId}&tell=${params.tell}`)
}

module.exports = {
    getUser,
    updatePhone,
    decodePhone
}